package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestThread {
	public static void main(String[] args){
		/*LiftOff liftOff1 = new LiftOff();
		LiftOff liftOff2 = new LiftOff();
		Thread t1 = new Thread(liftOff1);
		Thread t2 = new Thread(liftOff2);
		t1.start();
		//System.out.println();
		t2.start();*/
		ExecutorService exec = Executors.newCachedThreadPool();
		for(int i = 0; i < 5; i++){
			exec.execute(new LiftOff());
		}
		exec.shutdown();
		
		
		
		/*for(int i = 0; i < 5; i++){
			new Thread(new LiftOff()).start();
		}*/
		System.out.println("This is in main.");
	}

}
